<template>
  <div class="home">

    <a-layout style="height: 400px;">
      <a-layout>
        <a-layout-content>
          <HelloWorld/>
        </a-layout-content>
        <a-layout-sider style="width: 606px">
          排行榜
        </a-layout-sider>
      </a-layout>
    </a-layout>

  </div>
</template>

<script lang="ts" setup>
import {defineComponent, onMounted, ref} from "vue";
import HelloWorld from "@/components/HelloWorld.vue";
import {QuestionControllerService} from "../../generated"; // @ is an alias to /src

// export default defineComponent({
//   name: "HomeView",
//   components: {
//     HelloWorld,
//   },
// });
let rankList = ref([]) as any;
const searchParams = ref({
  pageSize: 10,
  current: 1
})
/**
 * 初始化排行榜
 */
const initRank = async () => {
  const res = await QuestionControllerService.listQuestionSubmitByPageUsingPost(searchParams.value);
  let recordArray = res.data.records

  for (const item of recordArray) {
      rankList.value.push(item.userVO)
  }
  console.log('rankList.value ::',rankList.value)
}
onMounted(() => {
  initRank();
})
</script>
<style scoped>
.home {
  /*border: 2px solid;*/
}

.layout-demo :deep(.arco-layout-sider-children),
.layout-demo :deep(.arco-layout-content) {
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--color-white);
  font-size: 16px;
  font-stretch: condensed;
  text-align: center;
}


.layout-demo :deep(.arco-layout-sider) {
  width: 206px;
  background-color: var(--color-primary-light-3);
}

.layout-demo :deep(.arco-layout-content) {
  background-color: rgb(var(--arcoblue-6));
}


</style>